<?php
/**
 * ShopEx licence
 *
 * @copyright  Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn)
 * @license  http://ecos.shopex.cn/ ShopEx License
 */
 

class tbdata_queue_detailgets{

    function run(&$cursor_id,$params){
          //每次最多处理1个子分类
        $model = app::get('tbdata')->model('product');
		$sync = kernel::single('tbdata_sync');
        $db = kernel::database();
		$filter = $params['filter'];
		$filter['last_modify|sthan'] = $params['queue_time'];
		$rows = $model->getList('*',$filter,0,100);
		if($rows[0]){
			foreach($rows AS $row){
				$product_id = $row['product_id'];
				$cid = $row['cid'];
				$id = $row['id'];
				$sync->get_product_detail($product_id,$cid);
			}
			return 1;
		}else{
			return 0;
		}
    }
}
